package com.chiwen.web.controller.system;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.chiwen.common.annotation.Log;
import com.chiwen.common.constant.UserConstants;
import com.chiwen.common.core.controller.BaseController;
import com.chiwen.common.core.domain.AjaxResult;
import com.chiwen.common.core.page.TableDataInfo;
import com.chiwen.common.enums.BusinessType;
import com.chiwen.common.utils.poi.ExcelUtil;
import com.chiwen.system.domain.SysConfig;
import com.chiwen.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 参数配置 信息操作处理
 * 
 * @author Dipper
 */
@RestController
@RequestMapping("/aip")
public class SysTestController extends BaseController
{



    @PostMapping("/export")
    public AjaxResult export()
    {

        String url = "https://pay.ssl.kuaishou.com/payAPI/k/pay/kscoin/deposit/nlogin/kspay/cashier";
        JSONObject json = new JSONObject();
        json.put("ksCoin", "10");
        json.put("fen", "100");
        json.put("userId", "1766674677");
        json.put("customize", "true");
        json.put("kpn", "KUAISHOU");
        json.put("kpf", "PC_WEB");
        //头信息，多个头信息多次调用此方法即可
        String result = HttpRequest.post(url)
                .header("Content-Type", "application/json")
                .body(String.valueOf(json))
                .execute().body();
        System.out.println(result);
        return AjaxResult.success(result);
    }


}
